﻿package app.view.components.header 
{
	import flash.display.Sprite;
	import gs.easing.Expo;
	import gs.TweenLite;
	
	/**
	 * Базовый заголовок
	 * @author www
	 */
	public class HeadMarkerBase extends HeadMarker
	{
		// app.view.components.header.HeadMarkerBase
		
		private static const TIME_MASK:Number = 1.5;
		
		public static const DEFAULT_TEXT:String = 'EXPO 2010';
		public static const BGD_ORANGE:String = 'BGD_ORANGE';
		public static const BGD_RED:String = 'BGD_RED';
		public static const BGD_GREEN:String = 'BGD_GREEN';
		
		
		public function HeadMarkerBase() 
		{
			initial()
		}
		
		private function initial():void
		{
			maskHead.scaleX = 0;
			
			this.mouseChildren = false;
			this.mouseEnabled = false;
			this.mask = maskHead;
			
		}
		
		public function setBgdColor(color:String):void
		{
			switch (color) 
			{
				case BGD_ORANGE:
					bgdOrang.visible = true;
					bgdRed.visible = false;
					bgdGreen.visible = false;
				break;
						
				case BGD_RED:
					bgdOrang.visible = false;
					bgdRed.visible = true;
					bgdGreen.visible = false;
				break;
				case BGD_GREEN:
					bgdOrang.visible = false;
					bgdRed.visible = false;
					bgdGreen.visible = true;
				break;
			}
		}
		
		public function setHeadText(v:String='EXPO 2010'):void
		{
			text.htmlText = v;
		}
		
		public function show():void
		{
			TweenLite.to(maskHead, TIME_MASK, { scaleX: 1 ,ease:'none'} );
		}
		
		public function hide():void
		{
			TweenLite.to(maskHead, TIME_MASK, { scaleX: 0 ,ease:'none'} );
		}
	}

}